Make PyREPL disabling conditional on Shell integration setting for Python 3.13+#25281
Closed
Make PyREPL disabling conditional on Shell integration setting for Python 3.13+#25281
Conversation
… Python version Co-authored-by: anthonykim1 <62267334+anthonykim1@users.noreply.github.com>
…tation Co-authored-by: anthonykim1 <62267334+anthonykim1@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Mention PyREPL is disabled when Python shell integration is enabled for Python3.13 and above
Make PyREPL disabling conditional on shell integration setting for Python 3.13+
Jul 14, 2025
Member
|
@anthonykim1 is this one still active or is it stale? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PyREPL (Python's enhanced REPL introduced in Python 3.13) causes cursor indentation issues when used with VS Code's Python shell integration feature. The previous implementation unconditionally disabled PyREPL for all Python 3.13+ environments by setting
PYTHON_BASIC_REPL=1, but this prevented users from using PyREPL even when shell integration was disabled.Solution
This PR makes PyREPL disabling conditional based on the user's shell integration preference:
PYTHON_BASIC_REPL=1) only when:python.terminal.shellIntegration.enabled= true) ANDBehavior Matrix
PYTHON_BASIC_REPLnot setPYTHON_BASIC_REPLnot setPYTHON_BASIC_REPL=1PYTHON_BASIC_REPLnot set (safe fallback)Changes Made
Core Implementation
registerBasicRepl()insrc/client/terminals/pythonStartup.tsto conditionally set environment variable based on shell integration setting and Python versionDocumentation
package.nls.jsonto inform users that PyREPL is automatically disabled when shell integration is enabled for Python 3.13+Testing
Benefits
Fixes #25240.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.